package com.wuhongyu.service.impl;

import com.wuhongyu.base.BaseServiceImpl;
import com.wuhongyu.entity.User;
import com.wuhongyu.repository.UserDao;
import com.wuhongyu.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("userService")
public class UserServiceImpl extends BaseServiceImpl<User> implements UserService {

    private UserDao userDao;

    @Resource
    public void setDao(UserDao userDao){
        super.setBaseDao(userDao);
        this.userDao = userDao;
    }
    @Override
    public User login(String username ,String password){
        return userDao.login(username,password);
    }

    /**
     * 找出不是超级管理员的用户
     * @return
     */
    @Override
    public List<User> findAllExit(){
        return userDao.findByTypeIsNot("超级管理员");
    }

}